#ifndef ENGINE_H
#define ENGINE_H

#include "Wheel.hpp"

/**
 * The engine class links the robot to the wheels.
 *
 * The engine controls all the physical movements the robot wants to make. In this case that's only through the wheel class,
 * but when the robot gets more moving parts those too will be controlled through this class.
 */
class Engine
{
public:
	/**
	 * Enumeration for the state the engine is currently in.
	 */
	enum State
	{
		FORWARD, /**< Drive forward */
		BACKWARD, /**< Reverse */
		LEFT, /**< Turn left */
		RIGHT, /**< Turn right */
		STOP /**< Do nothing */
	};

	/**
	 * Constructor creates wheels.
	 * This constructor creates two instances of the Wheel class, coupled to the two physical wheels on the robot.
	 */
	Engine();

	/**
	 * Makes the robot drive forward.
	 */
	void driveForward();
	/**
	 * Makes the robot drive backward.
	 */
	void driveBackward();

	/**
	 * Makes the robot turn left.
	 */
	void turnLeft();
	/**
	 * Makes the robot turn right.
	 */
	void turnRight();
	/**
	 * Stops the robot.
	 */
	void stop();
	/**
	 * Returns the state the engine is currently in.
	 *
	 * @see State.hpp
	 * @see currentState
	 *
	 * @return the engine's current state.
	 */
	State getState();

	/**
	 * Changes the engine's current state.
	 *
	 * @param newState, the state the engine should enter next.
	 */
	void setState(State newState);
private:
	Wheel leftWheel, rightWheel;
	/**
	 * The state the engine currently has.
	 */
	State currentState;
};
#endif
